using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using GreyMagic;
using log4net;
using Triton.Common.LogUtilities;
using Triton.Game.Mapping;
using Triton.Game.Mono;

namespace ns27
{
	internal class Class276
	{
		public enum Enum20 : uint
		{
			End = 0u,
			Void = 1u,
			Boolean = 2u,
			Char = 3u,
			I1 = 4u,
			U1 = 5u,
			I2 = 6u,
			U2 = 7u,
			I4 = 8u,
			U4 = 9u,
			I8 = 10u,
			U8 = 11u,
			R4 = 12u,
			R8 = 13u,
			String = 14u,
			Ptr = 0xFu,
			ByRef = 0x10u,
			ValueType = 17u,
			Class = 18u,
			Var = 19u,
			Array = 20u,
			GenericInst = 21u,
			TypedByRef = 22u,
			I = 24u,
			U = 25u,
			FnPtr = 27u,
			Object = 28u,
			SzArray = 29u,
			Mvar = 30u,
			CmodReqd = 0x1Fu,
			CmodOpt = 0x20u,
			Internal = 33u,
			Modifier = 0x40u,
			Sentinel = 65u,
			Pinned = 69u,
			Enum = 85u
		}

		internal struct Struct107
		{
			internal uint uint_0;

			internal uint UInt32_0
			{
				get
				{
					return uint_0 & 1u;
				}
				set
				{
					uint_0 = value | uint_0;
				}
			}

			internal uint UInt32_1
			{
				get
				{
					return (uint_0 & 0xFFFFFFFEu) / 2u;
				}
				set
				{
					uint_0 = (value * 2) | uint_0;
				}
			}
		}

		private enum Enum21
		{
			MONO_TABLE_MODULE,
			MONO_TABLE_TYPEREF,
			MONO_TABLE_TYPEDEF,
			MONO_TABLE_FIELD_POINTER,
			MONO_TABLE_FIELD,
			MONO_TABLE_METHOD_POINTER,
			MONO_TABLE_METHOD,
			MONO_TABLE_PARAM_POINTER,
			MONO_TABLE_PARAM,
			MONO_TABLE_INTERFACEIMPL,
			MONO_TABLE_MEMBERREF,
			MONO_TABLE_CONSTANT,
			MONO_TABLE_CUSTOMATTRIBUTE,
			MONO_TABLE_FIELDMARSHAL,
			MONO_TABLE_DECLSECURITY,
			MONO_TABLE_CLASSLAYOUT,
			MONO_TABLE_FIELDLAYOUT,
			MONO_TABLE_STANDALONESIG,
			MONO_TABLE_EVENTMAP,
			MONO_TABLE_EVENT_POINTER,
			MONO_TABLE_EVENT,
			MONO_TABLE_PROPERTYMAP,
			MONO_TABLE_PROPERTY_POINTER,
			MONO_TABLE_PROPERTY,
			MONO_TABLE_METHODSEMANTICS,
			MONO_TABLE_METHODIMPL,
			MONO_TABLE_MODULEREF,
			MONO_TABLE_TYPESPEC,
			MONO_TABLE_IMPLMAP,
			MONO_TABLE_FIELDRVA,
			MONO_TABLE_UNUSED6,
			MONO_TABLE_UNUSED7,
			MONO_TABLE_ASSEMBLY,
			MONO_TABLE_ASSEMBLYPROCESSOR,
			MONO_TABLE_ASSEMBLYOS,
			MONO_TABLE_ASSEMBLYREF,
			MONO_TABLE_ASSEMBLYREFPROCESSOR,
			MONO_TABLE_ASSEMBLYREFOS,
			MONO_TABLE_FILE,
			MONO_TABLE_EXPORTEDTYPE,
			MONO_TABLE_MANIFESTRESOURCE,
			MONO_TABLE_NESTEDCLASS,
			MONO_TABLE_GENERICPARAM,
			MONO_TABLE_METHODSPEC,
			MONO_TABLE_GENERICPARAMCONSTRAINT
		}

		private struct Struct108
		{
			internal ushort ushort_0;

			internal ushort ushort_1;

			internal uint uint_0;

			internal IntPtr intptr_0;

			internal IntPtr intptr_1;

			internal readonly IntPtr intptr_2;

			private readonly uint uint_1;

			internal uint UInt32_0 => uint_1 & 1u;

			internal uint UInt32_1 => (uint_1 & 2) / 2u;

			internal uint UInt32_2 => (uint_1 & 0x7C) / 4u;

			internal uint UInt32_3 => (uint_1 & 0x80) / 128u;

			internal uint UInt32_4 => (uint_1 & 0x100) / 256u;

			internal uint UInt32_5 => (uint_1 & 0x200) / 512u;

			internal uint UInt32_6 => (uint_1 & 0x400) / 1024u;

			internal uint UInt32_7 => (uint_1 & 0x800) / 2048u;

			internal uint UInt32_8 => (uint_1 & 0x1000) / 4096u;

			internal uint UInt32_9 => (uint_1 & 0x2000) / 8192u;

			internal uint UInt32_10 => (uint_1 & 0x4000) / 16384u;

			internal uint UInt32_11 => (uint_1 & 0x8000) / 32768u;

			internal uint UInt32_12 => (uint_1 & 0xFFFF0000u) / 65536u;
		}

		[StructLayout(LayoutKind.Sequential, Pack = 1)]
		private struct Struct109
		{
			internal IntPtr intptr_0;

			internal ushort ushort_0;

			internal short short_0;

			internal uint uint_0;

			internal IntPtr intptr_1;

			internal uint UInt32_0
			{
				get
				{
					return uint_0 & 0xFFFFu;
				}
				set
				{
					uint_0 = value | uint_0;
				}
			}

			internal uint UInt32_1
			{
				get
				{
					return (uint_0 & 0x3F0000) / 65536u;
				}
				set
				{
					uint_0 = (value * 65536) | uint_0;
				}
			}

			internal uint UInt32_2
			{
				get
				{
					return (uint_0 & 0x400000) / 4194304u;
				}
				set
				{
					uint_0 = (value * 4194304) | uint_0;
				}
			}

			internal uint UInt32_3
			{
				get
				{
					return (uint_0 & 0x800000) / 8388608u;
				}
				set
				{
					uint_0 = (value * 8388608) | uint_0;
				}
			}

			internal uint UInt32_4
			{
				get
				{
					return (uint_0 & 0x1000000) / 16777216u;
				}
				set
				{
					uint_0 = (value * 16777216) | uint_0;
				}
			}

			internal uint UInt32_5
			{
				get
				{
					return (uint_0 & 0x2000000) / 33554432u;
				}
				set
				{
					uint_0 = (value * 33554432) | uint_0;
				}
			}

			internal uint UInt32_6
			{
				get
				{
					return (uint_0 & 0x4000000) / 67108864u;
				}
				set
				{
					uint_0 = (value * 67108864) | uint_0;
				}
			}
		}

		[StructLayout(LayoutKind.Sequential, Pack = 2)]
		internal struct Struct110
		{
			internal IntPtr intptr_0;

			internal uint uint_0;

			internal Struct107 struct107_0;

			internal uint UInt32_0 => uint_0 & 0xFFFFu;

			internal uint UInt32_1 => (uint_0 & 0xFF0000) / 65536u;

			internal uint UInt32_2 => (uint_0 & 0x3F000000) / 16777216u;

			internal uint UInt32_3 => (uint_0 & 0x40000000) / 1073741824u;

			internal uint UInt32_4 => (uint_0 & 0x80000000u) / 2147483648u;
		}

		[StructLayout(LayoutKind.Sequential, Pack = 2)]
		private struct Struct111
		{
			internal IntPtr intptr_0;

			internal IntPtr intptr_1;

			internal IntPtr intptr_2;

			internal ushort ushort_0;

			internal byte byte_0;

			internal int int_0;

			private uint uint_0;

			internal byte byte_1;

			private readonly uint uint_1;

			internal byte byte_2;

			internal IntPtr intptr_3;

			internal IntPtr intptr_4;

			internal IntPtr intptr_5;

			private readonly IntPtr intptr_6;

			private readonly IntPtr intptr_7;

			internal uint uint_2;

			internal int int_1;

			internal ushort ushort_1;

			internal ushort ushort_2;

			internal ushort ushort_3;

			internal ushort ushort_4;

			internal IntPtr intptr_8;

			internal IntPtr intptr_9;

			internal IntPtr intptr_10;

			internal IntPtr intptr_11;

			internal int int_2;

			internal uint uint_3;

			internal uint uint_4;

			internal uint uint_5;

			internal uint uint_6;

			internal uint uint_7;

			internal uint uint_8;

			internal IntPtr intptr_12;

			internal IntPtr intptr_13;

			internal IntPtr intptr_14;

			internal Struct110 struct110_0;

			internal Struct110 struct110_1;

			internal IntPtr intptr_15;

			internal IntPtr intptr_16;

			internal IntPtr intptr_17;

			internal IntPtr intptr_18;

			internal IntPtr intptr_19;

			internal IntPtr intptr_20;

			internal IntPtr intptr_21;

			internal uint UInt32_0
			{
				get
				{
					return uint_0 & 1u;
				}
				set
				{
					uint_0 = value | uint_0;
				}
			}

			internal uint UInt32_1 => (uint_0 & 2) / 2u;

			internal uint UInt32_2 => (uint_0 & 4) / 4u;

			internal uint UInt32_3 => (uint_0 & 8) / 8u;

			internal uint UInt32_4 => (uint_0 & 0x10) / 16u;

			internal uint UInt32_5 => (uint_0 & 0x20) / 32u;

			internal uint UInt32_6 => (uint_0 & 0x40) / 64u;

			internal uint UInt32_7 => (uint_0 & 0x80) / 128u;

			internal uint UInt32_8 => uint_1 & 0xFu;

			internal uint UInt32_9 => (uint_1 & 0x10) / 16u;

			internal uint UInt32_10 => (uint_1 & 0x20) / 32u;

			internal uint UInt32_11 => (uint_1 & 0x40) / 64u;

			internal uint UInt32_12 => (uint_1 & 0x80) / 128u;

			internal uint UInt32_13 => (uint_1 & 0x100) / 256u;

			internal uint UInt32_14 => (uint_1 & 0x200) / 512u;

			internal uint UInt32_15 => (uint_1 & 0x400) / 1024u;

			internal uint UInt32_16 => (uint_1 & 0x800) / 2048u;

			internal uint UInt32_17 => (uint_1 & 0x1000) / 4096u;

			internal uint UInt32_18 => (uint_1 & 0x2000) / 8192u;

			internal uint UInt32_19 => (uint_1 & 0x4000) / 16384u;

			internal uint UInt32_20 => (uint_1 & 0x8000) / 32768u;

			internal uint UInt32_21 => (uint_1 & 0x10000) / 65536u;

			internal uint UInt32_22 => (uint_1 & 0x20000) / 131072u;

			internal uint UInt32_23 => (uint_1 & 0x40000) / 262144u;

			internal uint UInt32_24 => (uint_1 & 0x80000) / 524288u;

			internal uint UInt32_25 => (uint_1 & 0x100000) / 1048576u;

			internal uint UInt32_26 => (uint_1 & 0x200000) / 2097152u;

			internal uint UInt32_27 => (uint_1 & 0x400000) / 4194304u;
		}

		private static readonly ILog ilog_0;

		private readonly Dictionary<Type, IntPtr> dictionary_0;

		private readonly IntPtr intptr_0;

		private readonly ExternalProcessMemory externalProcessMemory_0;

		private readonly IntPtr intptr_1;

		private readonly IntPtr intptr_2;

		private readonly IntPtr intptr_3;

		private readonly IntPtr intptr_4;

		private readonly IntPtr intptr_5;

		private readonly IntPtr intptr_6;

		private readonly IntPtr intptr_7;

		private readonly IntPtr intptr_8;

		private readonly IntPtr intptr_9;

		private readonly IntPtr intptr_10;

		private readonly IntPtr intptr_11;

		private readonly IntPtr intptr_12;

		private readonly IntPtr intptr_13;

		private readonly IntPtr intptr_14;

		private readonly IntPtr intptr_15;

		private readonly IntPtr intptr_16;

		private readonly IntPtr intptr_17;

		private readonly IntPtr intptr_18;

		private readonly IntPtr intptr_19;

		private readonly IntPtr intptr_20;

		private readonly IntPtr intptr_21;

		private readonly IntPtr intptr_22;

		private readonly IntPtr intptr_23;

		private readonly IntPtr intptr_24;

		private readonly IntPtr intptr_25;

		private readonly IntPtr intptr_26;

		private readonly IntPtr intptr_27;

		private readonly IntPtr intptr_28;

		private readonly IntPtr intptr_29;

		private readonly IntPtr intptr_30;

		private readonly IntPtr intptr_31;

		private readonly IntPtr intptr_32;

		private readonly IntPtr intptr_33;

		private readonly IntPtr intptr_34;

		private readonly IntPtr intptr_35;

		private readonly IntPtr intptr_36;

		private readonly IntPtr intptr_111;

		private readonly IntPtr intptr_112;

		private readonly IntPtr intptr_113;

		private readonly IntPtr intptr_114;

		private readonly IntPtr intptr_115;

		private readonly IntPtr intptr_116;
		internal void method_0()
		{
			externalProcessMemory_0.CallInjected(intptr_17, CallingConvention.Cdecl);
		}

		internal int method_1(string string_0)
		{
			using AllocatedMemory allocatedMemory = externalProcessMemory_0.CreateAllocatedMemory(string_0.Length + 1);
			allocatedMemory.WriteString(0, string_0, Encoding.ASCII);
			return method_17<int>(intptr_5, new object[1] { allocatedMemory.Address });
		}

		internal IntPtr method_2()
		{
			return method_17<IntPtr>(intptr_31, new object[1] { method_4() });
		}

		internal void method_3(IntPtr intptr_37)
		{
			externalProcessMemory_0.CallInjected(intptr_18, CallingConvention.Cdecl, intptr_37);
		}

		internal IntPtr method_4()
		{
			return method_17<IntPtr>(intptr_29, Array.Empty<object>());
		}

		internal IntPtr method_5(IntPtr intptr_37)
		{
			return method_17<IntPtr>(intptr_23, new object[2]
			{
				method_27(),
				intptr_37
			});
		}

		internal IntPtr method_6(IntPtr intptr_37, IntPtr intptr_38)
		{
			return method_17<IntPtr>(intptr_36, new object[2] { intptr_37, intptr_38 });
		}

		internal int method_7(IntPtr intptr_37)
		{
			return externalProcessMemory_0.Read<int>(intptr_37 + 12);
		}

		internal int method_8(IntPtr intptr_37)
		{
			return method_17<int>(intptr_35, new object[1] { intptr_37 });
		}

		internal IntPtr method_9(IntPtr intptr_37, int int_0, int int_1)
		{
			return method_17<IntPtr>(intptr_34, new object[3] { intptr_37, int_0, int_1 });
		}

		internal Class276(ExternalProcessMemory memory)
		{
			dictionary_0 = new Dictionary<Type, IntPtr>();
			externalProcessMemory_0 = memory;
			intptr_0 = method_18("mono-2.0-bdwgc.dll");
			intptr_1 = intptr_0 + 0x30ca0;//94   5D 00030CA0 mono_class_get
			intptr_2 = intptr_0 + 0x31cc0;//111   6E 00031CC0 mono_class_get_name
			intptr_3 = intptr_0 + 0x31cd0;//112   6F 00031CD0 mono_class_get_namespace
			intptr_4 = intptr_0 + 0x289a0;//21   14 000289A0 mono_assembly_get_image
			intptr_5 = intptr_0 + 0x31ce0;//113   70 00031CE0 mono_class_get_nested_types
			intptr_6 = intptr_0 + 0x2ace0;//47   2E 0002ACE0 mono_assembly_open
			intptr_7 = intptr_0 + 0x29180;//30   1D 00029180 mono_assembly_load_from_full
			intptr_8 = intptr_0 + 0x31520;//103   66 00031520 mono_class_get_fields
			intptr_9 = intptr_0 + 0x25cc0;//274  111 00025CC0 mono_domain_get
			intptr_10 = intptr_0 + 0xee030;//371  172 000EE030 mono_gchandle_free
			intptr_11 = intptr_0 + 0x9b570;//320  13F 0009B570 mono_field_get_value_object
			intptr_12 = intptr_0 + 0xee3c0;//374  175 000EE3C0 mono_gchandle_new
			intptr_13 = intptr_0 + 0x5cc10;//481  1E0 0005CC10 mono_image_open_from_data_with_name
			intptr_14 = intptr_0 + 0x5bd90;//466  1D1 0005BD90 mono_image_get_table_rows
			intptr_15 = intptr_0 + 0x629f0;//665  298 000629F0 mono_method_signature
			intptr_16 = intptr_0 + 0x320a0;//120   77 000320A0 mono_class_get_type
			intptr_17 = intptr_0 + 0x80937;
			intptr_18 = intptr_0 + 0xb27f0;//946  3B1 000B27F0 mono_thread_detach
			intptr_19 = intptr_0 + 0x31c50;//110   6D 00031C50 mono_class_get_methods
			intptr_20 = intptr_0 + 0x31d30;//114   71 00031D30 mono_class_get_nesting_type
			intptr_21 = intptr_0 + 0x38dd0;//301  12C 00038DD0 mono_event_get_raise_method
			intptr_22 = intptr_0 + 0x9e130;//710  2C5 0009E130 mono_object_unbox
			intptr_23 = intptr_0 + 0xd2fc0;//1005  3EC 000D2FC0 mono_type_get_object
			intptr_24 = intptr_0 + 0x9d4e0;//695  2B6 0009D4E0 mono_object_get_class
			intptr_25 = intptr_0 + 0xa0480;//930  3A1 000A0480 mono_string_new
			intptr_26 = intptr_0 + 0x9f360;//861  35C 0009F360 mono_runtime_invoke
			intptr_27 = intptr_0 + 0xb26f0;//945  3B0 000B26F0 mono_thread_current
			intptr_28 = intptr_0 + 0x31d90;//115   72 00031D90 mono_class_get_parent
			intptr_29 = intptr_0 + 0x26040;//437  1B4 00026040 mono_get_root_domain
			intptr_30 = intptr_0 + 0x38db0;//298  129 00038DB0 mono_event_get_name
			intptr_31 = intptr_0 + 0xb2120;//942  3AD 000B2120 mono_thread_attach
			intptr_32 = intptr_0 + 0xa0a30;//938  3A9 000A0A30 mono_string_to_utf8
			intptr_33 = intptr_0 + 0xa0d20;//949  3B4 000A0D20 mono_thread_get_main
			intptr_34 = intptr_0 + 0x992d0;//6    5 000992D0 mono_array_addr_with_size
			intptr_35 = intptr_0 + 0x2e410;//9    8 0002E410 mono_array_element_size
			intptr_36 = intptr_0 + 0x9d560;//698  2B9 0009D560 mono_object_get_virtual_method
			intptr_111 = intptr_0 + 0x9B8D0;//321  140 0009B8D0 mono_field_set_value
			intptr_112 = intptr_0 + 0x9B500;//319  13E 0009B500 mono_field_get_value
			intptr_113 = intptr_0 + 0x9B920;//322  141 0009B920 mono_field_static_get_value
			intptr_114 = intptr_0 + 0x9BA50;//323  142 0009BA50 mono_field_static_set_value
			intptr_115 = intptr_0 + 0x9ADD0;//147   92 0009ADD0 mono_class_vtable
			intptr_116 = intptr_0 + 0x38E80;//317  13C 00038E80 mono_field_get_parent
			method_15<bool>("boolean");
			method_15<object>("object");
			method_15<sbyte>("sbyte");
			method_15<byte>("byte");
			method_15<short>("int16");
			method_15<ushort>("uint16");
			method_15<int>("int32");
			method_15<uint>("uint32");
			method_15<long>("int64");
			method_15<ulong>("uint64");
			method_15<float>("single");
			method_15<double>("double");
			method_15<char>("char");
			method_15<string>("string");
			method_15<Enum>("enum");
		}

		internal uint method_10(IntPtr intptr_37, bool bool_0)
		{
			return method_17<uint>(intptr_12, new object[2]
			{
				intptr_37,
				bool_0 ? 1 : 0
			});
		}

		internal void method_11(uint uint_0)
		{
			method_17<int>(intptr_10, new object[1] { uint_0 });
		}

		internal IntPtr method_12(IntPtr intptr_37)
		{
			return method_17<IntPtr>(intptr_16, new object[1] { intptr_37 });
		}

		internal IntPtr method_13(IntPtr intptr_37)
		{
			return method_17<IntPtr>(intptr_15, new object[1] { intptr_37 });
		}

		internal IntPtr method_14(IntPtr intptr_37)
		{
			return method_17<IntPtr>(intptr_20, new object[1] { intptr_37 });
		}

		private void method_15<T>(string string_0)
		{
			dictionary_0.Add(typeof(T), method_17<IntPtr>(method_19($"mono_get_{string_0}_class"), Array.Empty<object>()));
		}

		private void method_16(IntPtr intptr_37, string string_0)
		{
			if (intptr_37 == IntPtr.Zero)
			{
				throw new Exception(string_0);
			}
		}

		private T method_17<T>(IntPtr intptr_37, params object[] object_0) where T : struct
		{
			T a = externalProcessMemory_0.CallInjected<T>(intptr_37, CallingConvention.Cdecl, object_0);
			return a;
		}

		internal IntPtr method_18(string string_0)
		{
			IntPtr procAddress = externalProcessMemory_0.GetProcAddress("kernel32.dll", "GetModuleHandleW");
			using AllocatedMemory allocatedMemory = externalProcessMemory_0.CreateAllocatedMemory(string_0.Length * 2 + 2);
			allocatedMemory.WriteString(0, string_0, Encoding.Unicode);
			return externalProcessMemory_0.CallInjected<IntPtr>(procAddress, CallingConvention.StdCall, new object[1] { allocatedMemory.Address });
		}

		internal IntPtr method_19(string string_0)
		{
			IntPtr procAddress = externalProcessMemory_0.GetProcAddress("kernel32.dll", "GetProcAddress");
			using AllocatedMemory allocatedMemory = externalProcessMemory_0.CreateAllocatedMemory(string_0.Length + 1);
			allocatedMemory.WriteString(0, string_0, Encoding.ASCII);
			return externalProcessMemory_0.CallInjected<IntPtr>(procAddress, CallingConvention.StdCall, new object[2] { intptr_0, allocatedMemory.Address });
		}

		internal Dictionary<string, IntPtr> method_20(string string_0, ref Dictionary<string, IntPtr> dictionary_1)
		{
			Dictionary<string, IntPtr> dictionary = new Dictionary<string, IntPtr>();
			IntPtr intPtr = method_29();
			IntPtr intPtr2 = method_30();
			_ = intPtr != intPtr2;
			if (intPtr2 == IntPtr.Zero)
			{
				throw new Exception("Code is not running on a mono thread!");
			}
			int int_;
			IntPtr intptr_ = method_40(string_0, out int_);
			method_16(intptr_, "Could not load assembly. Status: " + int_);
			IntPtr intptr_2 = method_39(intptr_);
			method_16(intptr_2, "Could not open mono image. Status: " + int_);
			foreach (IntPtr item in method_44(intptr_2))
			{
				if (item != IntPtr.Zero)
				{
					externalProcessMemory_0.Read<Struct111>(item);
					IntPtr intPtr3 = method_14(item);
					string text = method_45(item);
					if (intPtr3 != IntPtr.Zero)
					{
						text = string.Concat(method_44(intPtr3), ".", text);
					}
					string text2 = method_46(item);
					if (!dictionary.ContainsKey(string_0 + "~" + text2 + "." + text))
					{
						string key = string_0 + "~" + text2 + "." + text;
						dictionary.Add(key, item);
						dictionary_1.Add(key, method_12(item));
					}
				}
			}
			return dictionary;
		}

		internal IntPtr method_21(string string_0, string string_1, string string_2)
		{
			IntPtr intPtr = method_29();
			IntPtr intPtr2 = method_30();
			_ = intPtr != intPtr2;
			if (intPtr2 == IntPtr.Zero)
			{
				throw new Exception("Code is not running on a mono thread!");
			}
			int int_;
			IntPtr intptr_ = method_40(string_0, out int_);
			method_16(intptr_, "Could not load assembly. Status: " + int_);
			IntPtr intptr_2 = method_39(intptr_);
			method_16(intptr_2, "Could not open mono image. Status: " + int_);
			foreach (IntPtr item in method_44(intptr_2))
			{
				if (item != IntPtr.Zero)
				{
					string text = method_45(item);
					string text2 = method_46(item);
					if (text == string_2 && text2 == string_1)
					{
						return item;
					}
				}
			}
			Debugger.Break();
			return IntPtr.Zero;
		}
		public StreamWriter streamWriter;
		internal IntPtr method_22(IntPtr intptr_37, IntPtr intptr_38)
		{

			IntPtr intPtr = method_27();

			IntPtr re= method_17<IntPtr>(intptr_11, new object[3] { intPtr, intptr_38, intptr_37 });

			return re;
		}

		public IntPtr smethod_2211<T>(IntPtr intptr_38) where T : struct
		{
			
			IntPtr idomain = method_27();
			IntPtr ifield = intptr_38;
			IntPtr iMonoClass = method_17<IntPtr>(intptr_116, new object[1] { ifield });
			IntPtr iMonoVTable = method_17<IntPtr>(intptr_115, new object[2] { idomain, iMonoClass });

			IntPtr re=method_431111<T>(iMonoVTable, ifield, new object[1] { 1 });
			//(MonoVTable *vt, MonoClassField *field, void *value);
			return re;
		}
		public void smethod_22111<T>(IntPtr intptr_38, T value) where T : struct
		{

			IntPtr idomain = method_27();
			IntPtr ifield = intptr_38;
			IntPtr iMonoClass = method_17<IntPtr>(intptr_116, new object[1] { ifield });
			IntPtr iMonoVTable = method_17<IntPtr>(intptr_115, new object[2] { idomain, iMonoClass });

			method_43111111<T>(iMonoVTable, ifield, new object[1] { value });
			//(MonoVTable *vt, MonoClassField *field, void *value);
		}
		internal void method_43111111<T>(IntPtr iMonoVTable, IntPtr ifield, params object[] object_0) where T : struct
		{
			if (object_0 != null && object_0.Length != 0)
			{
				using (AllocatedMemory allocatedMemory = externalProcessMemory_0.CreateAllocatedMemory(16))
				{
					//allocatedMemory.AllocateOfChunk("ArrayPtrs", 512);
					allocatedMemory.AllocateOfChunk("Ptrs", 512);
					int num = 0;
					int num2 = 0;
					foreach (object obj in object_0)
					{
						object obj2 = obj;
						if (MonoClass.IsOutParam(num, out var addr))
						{
							obj2 = addr;
						}
						MonoClass monoClass = obj as MonoClass;
						if (monoClass != null)
						{
							obj2 = monoClass.GetClassInstance();
						}
						else if (obj != null)
						{
							string text = obj as string;
							if (text != null)
							{
								obj2 = method_28(text);
							}
							else if (obj.GetType().IsEnum)
							{
								obj2 = Convert.ChangeType(obj2, ((Enum)obj2).GetTypeCode());
							}
						}
						else
						{
							obj2 = IntPtr.Zero;
						}
						int num3 = 4;
						if (!(obj2 is IntPtr))
						{
							if (obj2 is long)
							{
								allocatedMemory.Write("Ptrs", num2, (long)obj2);
								num3 = 8;
							}
							else if (obj2 is ulong)
							{
								allocatedMemory.Write("Ptrs", num2, (ulong)obj2);
								num3 = 8;
							}
							else if (obj2 is uint)
							{
								allocatedMemory.Write("Ptrs", num2, (uint)obj2);
							}
							else if (obj2 is int)
							{
								int bbbb = (int)obj2;
								allocatedMemory.Write("Ptrs", num2, bbbb);
							}
							else if (obj2 is bool)
							{
								allocatedMemory.Write("Ptrs", num2, ((bool)obj2) ? 1 : 0);
							}
							else if (obj2 is double)
							{
								allocatedMemory.Write("Ptrs", num2, (double)obj2);
								num3 = 8;
							}
							else if (obj2 is float)
							{
								allocatedMemory.Write("Ptrs", num2, (float)obj2);
							}
							else if (obj2 is Vector3)
							{
								Vector3 vector = (Vector3)obj2;
								allocatedMemory.Write("Ptrs", num2 + 0, vector.X);
								allocatedMemory.Write("Ptrs", num2 + 4, vector.Y);
								allocatedMemory.Write("Ptrs", num2 + 8, vector.Z);
								num3 = 12;
							}
							else
							{
								if (!(obj2 is RaycastHit))
								{
									throw new Exception("Unknown type passed as argument: " + obj2.GetType());
								}
								RaycastHit raycastHit = (RaycastHit)obj2;
								allocatedMemory.Write("Ptrs", num2 + 0, raycastHit.Point.X);
								allocatedMemory.Write("Ptrs", num2 + 4, raycastHit.Point.Y);
								allocatedMemory.Write("Ptrs", num2 + 8, raycastHit.Point.Z);
								allocatedMemory.Write("Ptrs", num2 + 12, raycastHit.Normal.X);
								allocatedMemory.Write("Ptrs", num2 + 16, raycastHit.Normal.Y);
								allocatedMemory.Write("Ptrs", num2 + 20, raycastHit.Normal.Z);
								allocatedMemory.Write("Ptrs", num2 + 24, raycastHit.FaceID);
								allocatedMemory.Write("Ptrs", num2 + 28, raycastHit.Distance);
								allocatedMemory.Write("Ptrs", num2 + 32, raycastHit.UV.X);
								allocatedMemory.Write("Ptrs", num2 + 36, raycastHit.UV.Y);
								num3 = 40;
							}
						}
						num++;
						num2 += num3;
					}
					IntPtr b = allocatedMemory["Ptrs"];
					method_17<IntPtr>(intptr_114, new object[3] { iMonoVTable, ifield, b });
					
				}
			}
			
		}
		internal IntPtr method_431111<T>(IntPtr iMonoVTable, IntPtr ifield, params object[] object_0) where T : struct
		{
			if (object_0 != null && object_0.Length != 0)
			{
				using (AllocatedMemory allocatedMemory = externalProcessMemory_0.CreateAllocatedMemory(2048))
				{
					allocatedMemory.AllocateOfChunk("ArrayPtrs", 512);
					allocatedMemory.AllocateOfChunk("Args", 512);
					int num = 0;
					int num2 = 0;
					foreach (object obj in object_0)
					{
						object obj2 = obj;
						if (MonoClass.IsOutParam(num, out var addr))
						{
							obj2 = addr;
						}
						MonoClass monoClass = obj as MonoClass;
						if (monoClass != null)
						{
							obj2 = monoClass.GetClassInstance();
						}
						else if (obj != null)
						{
							string text = obj as string;
							if (text != null)
							{
								obj2 = method_28(text);
							}
							else if (obj.GetType().IsEnum)
							{
								obj2 = Convert.ChangeType(obj2, ((Enum)obj2).GetTypeCode());
							}
						}
						else
						{
							obj2 = IntPtr.Zero;
						}
						int num3 = 4;
						if (!(obj2 is IntPtr))
						{
							if (obj2 is long)
							{
								allocatedMemory.Write("Args", num2, (long)obj2);
								num3 = 8;
							}
							else if (obj2 is ulong)
							{
								allocatedMemory.Write("Args", num2, (ulong)obj2);
								num3 = 8;
							}
							else if (obj2 is uint)
							{
								allocatedMemory.Write("Args", num2, (uint)obj2);
							}
							else if (obj2 is int)
							{
								allocatedMemory.Write("Args", num2, (int)obj2);
							}
							else if (obj2 is bool)
							{
								allocatedMemory.Write("Args", num2, ((bool)obj2) ? 1 : 0);
							}
							else if (obj2 is double)
							{
								allocatedMemory.Write("Args", num2, (double)obj2);
								num3 = 8;
							}
							else if (obj2 is float)
							{
								allocatedMemory.Write("Args", num2, (float)obj2);
							}
							else if (obj2 is Vector3)
							{
								Vector3 vector = (Vector3)obj2;
								allocatedMemory.Write("Args", num2 + 0, vector.X);
								allocatedMemory.Write("Args", num2 + 4, vector.Y);
								allocatedMemory.Write("Args", num2 + 8, vector.Z);
								num3 = 12;
							}
							else
							{
								if (!(obj2 is RaycastHit))
								{
									throw new Exception("Unknown type passed as argument: " + obj2.GetType());
								}
								RaycastHit raycastHit = (RaycastHit)obj2;
								allocatedMemory.Write("Args", num2 + 0, raycastHit.Point.X);
								allocatedMemory.Write("Args", num2 + 4, raycastHit.Point.Y);
								allocatedMemory.Write("Args", num2 + 8, raycastHit.Point.Z);
								allocatedMemory.Write("Args", num2 + 12, raycastHit.Normal.X);
								allocatedMemory.Write("Args", num2 + 16, raycastHit.Normal.Y);
								allocatedMemory.Write("Args", num2 + 20, raycastHit.Normal.Z);
								allocatedMemory.Write("Args", num2 + 24, raycastHit.FaceID);
								allocatedMemory.Write("Args", num2 + 28, raycastHit.Distance);
								allocatedMemory.Write("Args", num2 + 32, raycastHit.UV.X);
								allocatedMemory.Write("Args", num2 + 36, raycastHit.UV.Y);
								num3 = 40;
							}
						}
						if (obj2 is IntPtr)
						{
							allocatedMemory.Write("ArrayPtrs", 4 * num, (IntPtr)obj2);
						}
						else
						{
							allocatedMemory.Write("ArrayPtrs", 4 * num, allocatedMemory["Args"] + num2);
						}
						num++;
						num2 += num3;
					}
					IntPtr a = allocatedMemory["ArrayPtrs"];
					IntPtr b = allocatedMemory["Args"];
					method_17<IntPtr>(intptr_113, new object[3] { iMonoVTable, ifield, b });
					return allocatedMemory["Args"];
				}
			}
			method_17<IntPtr>(intptr_113, new object[3] { iMonoVTable, ifield, IntPtr.Zero });
			return IntPtr.Zero;
		}
		internal void method_2211<T>(IntPtr intptr_37, IntPtr intptr_38,T value) where T : struct//bald
		{
			method_4311<T>( intptr_37,  intptr_38, new object[1] { value });
			//externalProcessMemory_0.CallInjected(intptr_11, CallingConvention.Cdecl, new object[3] { intptr_37, intptr_38, value });
		}
		internal IntPtr method_23(IntPtr intptr_37)
		{
			return method_17<IntPtr>(intptr_24, new object[1] { intptr_37 });
		}

		internal string method_24(IntPtr intptr_37)
		{
			IntPtr address = method_17<IntPtr>(intptr_32, new object[1] { intptr_37 });
			return externalProcessMemory_0.ReadStringUTF8(address);
		}

		internal IntPtr method_25(IntPtr intptr_37)
		{
			return method_17<IntPtr>(intptr_28, new object[1] { intptr_37 });
		}

		internal IntPtr method_26(IntPtr intptr_37)
		{
			return method_17<IntPtr>(intptr_22, new object[1] { intptr_37 });
		}

		internal IntPtr method_27()
		{
			return method_17<IntPtr>(intptr_9, Array.Empty<object>());
		}

		internal IntPtr method_28(string string_0)
		{
			using AllocatedMemory allocatedMemory = externalProcessMemory_0.CreateAllocatedMemory((string_0.Length + 1) * 2);
			if (string_0.Length > 0)
			{
				allocatedMemory.WriteString(0, string_0, Encoding.UTF8);
			}
			else
			{
				allocatedMemory.Write(0, (ushort)0);
			}
			IntPtr intPtr = method_27();
			return method_17<IntPtr>(intptr_25, new object[2] { intPtr, allocatedMemory.Address });
		}

		internal IntPtr method_29()
		{
			return method_17<IntPtr>(intptr_33, Array.Empty<object>());
		}

		internal IntPtr method_30()
		{
			return method_17<IntPtr>(intptr_27, Array.Empty<object>());
		}

		internal Enum20[] method_31(IntPtr intptr_37)
		{
			List<Enum20> list = new List<Enum20>();
			IntPtr intPtr = method_13(intptr_37);
			Struct109 @struct = externalProcessMemory_0.Read<Struct109>(intPtr);
			IntPtr intPtr2 = intPtr + 8;
			for (int i = 1; i < @struct.ushort_0 + 1; i++)
			{
				IntPtr addr = externalProcessMemory_0.Read<IntPtr>(intPtr2 + i * 4);
				Enum20 uInt32_ = (Enum20)externalProcessMemory_0.Read<Struct110>(addr).UInt32_1;
				list.Add(uInt32_);
			}
			return list.ToArray();
		}

		internal void method_32(IntPtr intptr_37)
		{
			string text = "";
			while (intptr_37 != IntPtr.Zero)
			{
				using AllocatedMemory allocatedMemory = externalProcessMemory_0.CreateAllocatedMemory(256);
				allocatedMemory.AllocateOfChunk<IntPtr>("Itr");
				IntPtr intPtr;
				while ((intPtr = method_35(intptr_37, allocatedMemory["Itr"])) != IntPtr.Zero)
				{
					Struct108 @struct = externalProcessMemory_0.Read<Struct108>(intPtr);
					IntPtr intPtr2 = method_13(intPtr);
					Struct109 struct2 = externalProcessMemory_0.Read<Struct109>(intPtr2);
					IntPtr intPtr3 = intPtr2 + 8;
					StringBuilder stringBuilder = new StringBuilder();
					for (int i = 1; i < struct2.ushort_0 + 1; i++)
					{
						IntPtr addr = externalProcessMemory_0.Read<IntPtr>(intPtr3 + i * 4);
						Enum20 uInt32_ = (Enum20)externalProcessMemory_0.Read<Struct110>(addr).UInt32_1;
						stringBuilder.Append(uInt32_);
						if (i != struct2.ushort_0)
						{
							stringBuilder.Append(", ");
						}
					}
					string text2 = externalProcessMemory_0.ReadStringUTF8(@struct.intptr_2);
					ilog_0.Debug(string.Concat(text, text2, "(", stringBuilder, ")"));
				}
				intptr_37 = method_25(intptr_37);
				if (intptr_37 != IntPtr.Zero)
				{
					string text3 = method_45(intptr_37);
					ilog_0.Debug("Base class: " + text3);
				}
			}
		}

		internal IntPtr method_33(IntPtr intptr_37, string string_0, params Enum20[] enum20_0)
		{
			while (intptr_37 != IntPtr.Zero)
			{
				using AllocatedMemory allocatedMemory = externalProcessMemory_0.CreateAllocatedMemory(256);
				allocatedMemory.AllocateOfChunk<IntPtr>("Itr");
				IntPtr intPtr;
				while ((intPtr = method_35(intptr_37, allocatedMemory["Itr"])) != IntPtr.Zero)
				{
					IntPtr address = method_37(intPtr);
					if (!(externalProcessMemory_0.ReadStringA(address) == string_0))
					{
						continue;
					}
					if (enum20_0 != null)
					{
						Enum20[] array = method_31(intPtr);
						if (array.Length != enum20_0.Length || !array.SequenceEqual(enum20_0))
						{
							continue;
						}
					}
					return intPtr;
				}
				intptr_37 = method_25(intptr_37);
			}
			return IntPtr.Zero;
		}

		internal IntPtr method_34(IntPtr intptr_37, string string_0)
		{
			while (intptr_37 != IntPtr.Zero)
			{
				using (AllocatedMemory allocatedMemory = externalProcessMemory_0.CreateAllocatedMemory(256))
				{
					allocatedMemory.AllocateOfChunk<IntPtr>("Itr");
					IntPtr intPtr;
					while ((intPtr = method_36(intptr_37, allocatedMemory["Itr"])) != IntPtr.Zero)
					{
						IntPtr address = method_38(intPtr);
						if (externalProcessMemory_0.ReadStringA(address) == string_0)
						{
							return intPtr;
						}
					}
				}
				intptr_37 = method_25(intptr_37);
			}
			return IntPtr.Zero;
		}

		internal IntPtr method_35(IntPtr intptr_37, IntPtr intptr_38)
		{
			return method_17<IntPtr>(intptr_19, new object[2] { intptr_37, intptr_38 });
		}

		internal IntPtr method_36(IntPtr intptr_37, IntPtr intptr_38)
		{
			return method_17<IntPtr>(intptr_8, new object[2] { intptr_37, intptr_38 });
		}

		internal IntPtr method_37(IntPtr intptr_37)
		{
			return method_17<IntPtr>(intptr_21, new object[1] { intptr_37 });
		}

		internal IntPtr method_38(IntPtr intptr_37)
		{
			return method_17<IntPtr>(intptr_30, new object[1] { intptr_37 });
		}

		internal IntPtr method_39(IntPtr intptr_37)
		{
			return method_17<IntPtr>(intptr_4, new object[1] { intptr_37 });
		}

		internal IntPtr method_40(string string_0, out int int_0)
		{
			using AllocatedMemory allocatedMemory = externalProcessMemory_0.CreateAllocatedMemory(string_0.Length * 2 + 2 + 4);
			allocatedMemory.WriteString(4, string_0, Encoding.UTF8);
			IntPtr result = method_17<IntPtr>(intptr_6, new object[2]
			{
				allocatedMemory.Address + 4,
				allocatedMemory.Address
			});
			int_0 = allocatedMemory.Read<int>(0);
			return result;
		}

		internal IntPtr method_41(byte[] byte_0, bool bool_0, bool bool_1, string string_0, out int int_0)
		{
			using AllocatedMemory allocatedMemory = externalProcessMemory_0.CreateAllocatedMemory(byte_0.Length);
			allocatedMemory.WriteBytes(0, byte_0);
			using AllocatedMemory allocatedMemory2 = externalProcessMemory_0.CreateAllocatedMemory(4 + string_0.Length + 1);
			allocatedMemory2.AllocateOfChunk<int>("Status");
			allocatedMemory2.AllocateOfChunk("Name", string_0.Length + 1);
			allocatedMemory2.WriteString("Name", string_0, Encoding.ASCII);
			IntPtr result = method_17<IntPtr>(intptr_13, new object[6]
			{
				allocatedMemory.Address,
				byte_0.Length,
				bool_0 ? 1 : 0,
				allocatedMemory2["Status"],
				bool_1 ? 1 : 0,
				allocatedMemory2["Name"]
			});
			int_0 = allocatedMemory2.Read<int>("Status");
			return result;
		}

		internal IntPtr method_42(IntPtr intptr_37, string string_0, bool bool_0, out int int_0)
		{
			byte[] bytes = Encoding.UTF8.GetBytes(string_0 + "\0");
			using AllocatedMemory allocatedMemory = externalProcessMemory_0.CreateAllocatedMemory(bytes.Length + 4);
			allocatedMemory.AllocateOfChunk<int>("Status");
			allocatedMemory.AllocateOfChunk("Name", bytes.Length);
			allocatedMemory.WriteBytes("Name", bytes);
			IntPtr result = method_17<IntPtr>(intptr_7, new object[4]
			{
				intptr_37,
				allocatedMemory["Name"],
				allocatedMemory["Status"],
				bool_0 ? 1 : 0
			});
			int_0 = allocatedMemory.Read<int>("Status");
			return result;
		}
		// method_0(string_4, enum20_0):intptr_37 classInstance:intptr_38
		internal IntPtr method_43(IntPtr intptr_37,  IntPtr intptr_38, params object[] object_0)
		{
			if (object_0 != null && object_0.Length != 0)
			{
				using (AllocatedMemory allocatedMemory = externalProcessMemory_0.CreateAllocatedMemory(2048))
				{
					allocatedMemory.AllocateOfChunk("ArrayPtrs", 512);
					allocatedMemory.AllocateOfChunk("Args", 512);
					int num = 0;
					int num2 = 0;
					foreach (object obj in object_0)
					{
						object obj2 = obj;
						if (MonoClass.IsOutParam(num, out var addr))
						{
							obj2 = addr;
						}
						MonoClass monoClass = obj as MonoClass;
						if (monoClass != null)
						{
							obj2 = monoClass.GetClassInstance();
						}
						else if (obj != null)
						{
							string text = obj as string;
							if (text != null)
							{
								obj2 = method_28(text);
							}
							else if (obj.GetType().IsEnum)
							{
								obj2 = Convert.ChangeType(obj2, ((Enum)obj2).GetTypeCode());
							}
						}
						else
						{
							obj2 = IntPtr.Zero;
						}
						int num3 = 4;
						if (!(obj2 is IntPtr))
						{
							if (obj2 is long)
							{
								allocatedMemory.Write("Args", num2, (long)obj2);
								num3 = 8;
							}
							else if (obj2 is ulong)
							{
								allocatedMemory.Write("Args", num2, (ulong)obj2);
								num3 = 8;
							}
							else if (obj2 is uint)
							{
								allocatedMemory.Write("Args", num2, (uint)obj2);
							}
							else if (obj2 is int)
							{
								allocatedMemory.Write("Args", num2, (int)obj2);
							}
							else if (obj2 is bool)
							{
								allocatedMemory.Write("Args", num2, ((bool)obj2) ? 1 : 0);
							}
							else if (obj2 is double)
							{
								allocatedMemory.Write("Args", num2, (double)obj2);
								num3 = 8;
							}
							else if (obj2 is float)
							{
								allocatedMemory.Write("Args", num2, (float)obj2);
							}
							else if (obj2 is Vector3)
							{
								Vector3 vector = (Vector3)obj2;
								allocatedMemory.Write("Args", num2 + 0, vector.X);
								allocatedMemory.Write("Args", num2 + 4, vector.Y);
								allocatedMemory.Write("Args", num2 + 8, vector.Z);
								num3 = 12;
							}
							else
							{
								if (!(obj2 is RaycastHit))
								{
									throw new Exception("Unknown type passed as argument: " + obj2.GetType());
								}
								RaycastHit raycastHit = (RaycastHit)obj2;
								allocatedMemory.Write("Args", num2 + 0, raycastHit.Point.X);
								allocatedMemory.Write("Args", num2 + 4, raycastHit.Point.Y);
								allocatedMemory.Write("Args", num2 + 8, raycastHit.Point.Z);
								allocatedMemory.Write("Args", num2 + 12, raycastHit.Normal.X);
								allocatedMemory.Write("Args", num2 + 16, raycastHit.Normal.Y);
								allocatedMemory.Write("Args", num2 + 20, raycastHit.Normal.Z);
								allocatedMemory.Write("Args", num2 + 24, raycastHit.FaceID);
								allocatedMemory.Write("Args", num2 + 28, raycastHit.Distance);
								allocatedMemory.Write("Args", num2 + 32, raycastHit.UV.X);
								allocatedMemory.Write("Args", num2 + 36, raycastHit.UV.Y);
								num3 = 40;
							}
						}
						if (obj2 is IntPtr)
						{
							allocatedMemory.Write("ArrayPtrs", 4 * num, (IntPtr)obj2);
						}
						else
						{
							allocatedMemory.Write("ArrayPtrs", 4 * num, allocatedMemory["Args"] + num2);
						}
						num++;
						num2 += num3;
					}
					return method_17<IntPtr>(intptr_26, new object[4]
					{
						intptr_37,
						intptr_38,
						allocatedMemory["ArrayPtrs"],
						IntPtr.Zero
					});
				}
			}
			return method_17<IntPtr>(intptr_26, new object[4]
			{
				intptr_37,
				intptr_38,
				IntPtr.Zero,
				IntPtr.Zero
			});
		}
		// MonoObject:intptr_37 MonoClassField:intptr_38
		internal void method_4311<T>(IntPtr intptr_37, IntPtr intptr_38, params object[] object_0) where T : struct
		{
			if (object_0 != null && object_0.Length != 0)
			{
				using (AllocatedMemory allocatedMemory = externalProcessMemory_0.CreateAllocatedMemory(1024))
				{
					allocatedMemory.AllocateOfChunk("ArrayPtrs", 512);
					allocatedMemory.AllocateOfChunk("Args", 512);
					int num = 0;
					int num2 = 0;
					foreach (object obj in object_0)
					{
						object obj2 = obj;
						if (MonoClass.IsOutParam(num, out var addr))
						{
							obj2 = addr;
						}
						MonoClass monoClass = obj as MonoClass;
						if (monoClass != null)
						{
							obj2 = monoClass.GetClassInstance();
						}
						else if (obj != null)
						{
							string text = obj as string;
							if (text != null)
							{
								obj2 = method_28(text);
							}
							else if (obj.GetType().IsEnum)
							{
								obj2 = Convert.ChangeType(obj2, ((Enum)obj2).GetTypeCode());
							}
						}
						else
						{
							obj2 = IntPtr.Zero;
						}
						int num3 = 4;
						if (!(obj2 is IntPtr))
						{
							if (obj2 is long)
							{
								allocatedMemory.Write("Args", num2, (long)obj2);
								num3 = 8;
							}
							else if (obj2 is ulong)
							{
								allocatedMemory.Write("Args", num2, (ulong)obj2);
								num3 = 8;
							}
							else if (obj2 is uint)
							{
								allocatedMemory.Write("Args", num2, (uint)obj2);
							}
							else if (obj2 is int)
							{
								allocatedMemory.Write("Args", num2, (int)obj2);
							}
							else if (obj2 is bool)
							{
								allocatedMemory.Write("Args", num2, ((bool)obj2) ? 1 : 0);
							}
							else if (obj2 is double)
							{
								allocatedMemory.Write("Args", num2, (double)obj2);
								num3 = 8;
							}
							else if (obj2 is float)
							{
								allocatedMemory.Write("Args", num2, (float)obj2);
							}
							else if (obj2 is Vector3)
							{
								Vector3 vector = (Vector3)obj2;
								allocatedMemory.Write("Args", num2 + 0, vector.X);
								allocatedMemory.Write("Args", num2 + 4, vector.Y);
								allocatedMemory.Write("Args", num2 + 8, vector.Z);
								num3 = 12;
							}
							else
							{
								if (!(obj2 is RaycastHit))
								{
									throw new Exception("Unknown type passed as argument: " + obj2.GetType());
								}
								RaycastHit raycastHit = (RaycastHit)obj2;
								allocatedMemory.Write("Args", num2 + 0, raycastHit.Point.X);
								allocatedMemory.Write("Args", num2 + 4, raycastHit.Point.Y);
								allocatedMemory.Write("Args", num2 + 8, raycastHit.Point.Z);
								allocatedMemory.Write("Args", num2 + 12, raycastHit.Normal.X);
								allocatedMemory.Write("Args", num2 + 16, raycastHit.Normal.Y);
								allocatedMemory.Write("Args", num2 + 20, raycastHit.Normal.Z);
								allocatedMemory.Write("Args", num2 + 24, raycastHit.FaceID);
								allocatedMemory.Write("Args", num2 + 28, raycastHit.Distance);
								allocatedMemory.Write("Args", num2 + 32, raycastHit.UV.X);
								allocatedMemory.Write("Args", num2 + 36, raycastHit.UV.Y);
								num3 = 40;
							}
						}
						if (obj2 is IntPtr)
						{
							allocatedMemory.Write("ArrayPtrs", 4 * num, (IntPtr)obj2);
						}
						else
						{
							allocatedMemory.Write("ArrayPtrs", 4 * num, allocatedMemory["Args"] + num2);
						}
						num++;
						num2 += num3;
					}
					IntPtr a = allocatedMemory["ArrayPtrs"];
					IntPtr b = allocatedMemory["Args"];
					externalProcessMemory_0.CallInjected(intptr_112, CallingConvention.Cdecl, new object[3]
					{
						intptr_37,
						intptr_38,
						allocatedMemory["Args"]
					});
					return;
				}
			}

			externalProcessMemory_0.CallInjected(intptr_37, CallingConvention.Cdecl, new object[3]
			{
				intptr_37,
				intptr_38,
				IntPtr.Zero
			});
		}
		internal IEnumerable<IntPtr> method_44(IntPtr intptr_37)
		{
			int num = method_17<int>(intptr_14, new object[2] { intptr_37, 2 });
			for (int i = 1; i < num + 1; i++)
			{
				yield return externalProcessMemory_0.CallInjected<IntPtr>(intptr_1, CallingConvention.Cdecl, new object[2]
				{
					intptr_37,
					i | 0x2000000
				});
			}
		}

		internal string method_45(IntPtr intptr_37)
		{
			IntPtr intPtr = method_14(intptr_37);
			string text = "";
			while (intPtr != IntPtr.Zero)
			{
				text = method_45(intPtr) + "." + text;
				intPtr = method_14(intPtr);
			}
			return text + externalProcessMemory_0.ReadStringA(method_17<IntPtr>(intptr_2, new object[1] { intptr_37 }));
		}

		internal string method_46(IntPtr intptr_37)
		{
			return externalProcessMemory_0.ReadStringA(method_17<IntPtr>(intptr_3, new object[1] { intptr_37 }));
		}

		static Class276()
		{
			ilog_0 = Triton.Common.LogUtilities.Logger.GetLoggerInstanceForType();
		}
	}
}
